Get class of an object variable php

48

<?php

namespace Foo\Bar;

class Baz {
    public function __construct()
    {

    }
}

$baz = new \Foo\Bar\Baz;
// get class of namespaced classes
var_dump(get_class($baz)); // result: string(11) "Foo\Bar\Baz"
?>

Comments

Submit
0 Comments